from pyecharts.charts import Map
from pyecharts.options import VisualMapOpts

map = Map()
data = [
    ("贵州省",99),
    ("西藏自治区",199),
    ("四川省",299),
    ("重庆市",399),
    ("云南省",566)
]
map.add("中国地图",data)
map.set_global_opts(
    visualmap_opts = VisualMapOpts(
        is_show = True,
        is_piecewise = True,
        pieces = [
            {"min":1,"max":9,"label":"1-9","color":"#CCFFFF"},
            {"min":10,"max":99,"label":"10-99","color":"#FFFF99"},
            {"min":100,"max":199,"label":"100-199","color":"#FF9966"},
            {"min":200,"max":299,"label":"200-299","color":"#FF6666"},
            {"min":300,"max":399,"label":"300-399","color":"#CC3333"},
            {"min":400,"max":600,"label":"400-600","color":"#990033"},
        ]
    )

)

map.render()